#include "../func.h"

int main()
{
    if (!fork())
    {
        printf("child pid = %d, ppid = %d\n", getpid(), getppid());
        float i;
        return 5;
    }
    else
    {
        printf("parent pid = %d\n", getpid());
        int status;
        pid_t cpid;
        cpid = wait(&status);
        printf("wait child success, %d\n", cpid);
        if (WIFEXITED(status))
        {
            printf("the child exist value = %d\n", WEXITSTATUS(status));
        }
        else
        {
            printf("child crash\n");
        }
    }
    return 0;
}
